let mysql = require('mysql');
//连接MySQL数据库
let client = mysql.createConnection({
    host: 'localhost',
    port:"3306",
    user: 'root',
    password: '540760',
    database: 'Library'
});
//判断数据库是否连接成功
client.connect(function(err){
    if(err){
         console.log('[query] - :'+err);
         return;
    }
    console.log('[connection connect]  MySQL数据库连接成功!');
});
//导出
module.exports = client;